package com.greystripe.sdk;

import android.content.Context;
import android.content.Intent;

public final class GSFullscreenAd extends c
{
  protected static GSFullscreenAd c;
  private static boolean e = false;
  protected at d;
  private Context f;
  private boolean g = false;
  private as h;

  public GSFullscreenAd(Context paramContext)
  {
    this(paramContext, null);
  }

  public GSFullscreenAd(Context paramContext, String paramString)
  {
    super(paramContext);
    this.f = paramContext.getApplicationContext();
    a("s", "fs");
    if (!bj.b(bk.GUID))
      bj.a(paramString);
    a("guid", bj.b());
    this.h = new as();
    j().addJavascriptInterface(this.h, "FullscreenController");
    this.d = new at(this);
    j().addJavascriptInterface(this.d, "Video");
    super.addListener(new bb(this, (byte)0));
  }

  final void a()
  {
    e = true;
  }

  final void a(GSFullscreenActivity paramGSFullscreenActivity)
  {
    this.h.a(paramGSFullscreenActivity);
  }

  final void b()
  {
    e = false;
  }

  final void c()
  {
    this.h.close();
  }

  public final void display()
  {
    try
    {
      boolean bool = isAdReady();
      if (!bool);
      while (true)
      {
        return;
        if (c == null)
        {
          c = this;
          this.g = false;
          Intent localIntent = new Intent(this.f, GSFullscreenActivity.class);
          localIntent.addFlags(268435456);
          this.f.startActivity(localIntent);
        }
      }
    }
    finally
    {
    }
  }

  public final void fetch()
  {
    while (true)
    {
      try
      {
        if (e())
        {
          bd.d("There's an ad already displayed. Cannot request another ad at this time.", new Object[0]);
          return;
        }
        if (isAdReady())
        {
          g();
          continue;
        }
      }
      finally
      {
      }
      if (e)
        a(GSAdErrorCode.FETCH_LIMIT_EXCEEDED);
      else
        h();
    }
  }

  final void k()
  {
    j().b("RAC.close();");
  }

  final boolean l()
  {
    return this.g;
  }

  final int m()
  {
    return this.h.getOrientation();
  }

  final void n()
  {
    this.h.a();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.greystripe.sdk.GSFullscreenAd
 * JD-Core Version:    0.6.2
 */